import Mock from 'mockjs'


const data = Mock.mock({
    "list|100": [
        {
            "id|+1": 1,
            "pic": "@image(100x100,@color,宁)"
        }
    ]
})



//定义 轮播图接口
Mock.mock('/swiper', 'post', function (optoins) {
    //解析参数
    let params = JSON.parse(optoins.body);
    let { count } = params;
    let tempData = data.list.slice(0, count);
    return {
        "list": tempData
    }
})


const shopData = require("./data.json")

Mock.mock("/shoplist","get",function(){return shopData})

//定义菜单数据

const goods=Mock.mock({
    "list|6":[
        {
            "title|+1":["热销","优惠","三文鱼","刺身","年货礼品区","野生大虾","栋获取",],
            "content|6":[
                {
                    "name":"@ctitle(5,10)",
                    "pic|+1":["/banner/1.jpg","/banner/2.jpg","/banner/3.jpg","/banner/4.jpg","/banner/5.jpg","/banner/6.jpg",],
                    "id|+1":1,
                    "count":1,
                    "contents":"@ctitle(15,25)",
                    "pirce|40-120":0,
                }
            ]
        }
    ]
})

Mock.mock("/list","get",function(){
    return goods
})